package com.itcncp.ucenter.dao.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.itcncp.common.plugin.ToStringSerializer;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

public class UserAccountInfo implements Serializable {
    /**
     * 用户id
     *
     * @mbg.generated
     */
    @JSONField(serializeUsing= ToStringSerializer.class)
    private Long userId;

    /**
     * 账户类型 1、个人账户 2、企业账户
     *
     * @mbg.generated
     */
    private Byte accountType;

    /**
     * 账户余额
     *
     * @mbg.generated
     */
    private BigDecimal accountBalance;

    /**
     * 信用额
     *
     * @mbg.generated
     */
    private BigDecimal creditMoney;

    /**
     * 登记日期
     *
     * @mbg.generated
     */
    private Date accountRegisteDate;

    /**
     * 服务费余额
     *
     * @mbg.generated
     */
    private BigDecimal serviceFee;

    /**
     * 账户状态   1、锁定 2、正常
     *
     * @mbg.generated
     */
    private Byte accountState;

    /**
     * 清户或冻结日期
     *
     * @mbg.generated
     */
    private Date accountModifyDate;

    private static final long serialVersionUID = 1L;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Byte getAccountType() {
        return accountType;
    }

    public void setAccountType(Byte accountType) {
        this.accountType = accountType;
    }

    public BigDecimal getAccountBalance() {
        return accountBalance;
    }

    public void setAccountBalance(BigDecimal accountBalance) {
        this.accountBalance = accountBalance;
    }

    public BigDecimal getCreditMoney() {
        return creditMoney;
    }

    public void setCreditMoney(BigDecimal creditMoney) {
        this.creditMoney = creditMoney;
    }

    public Date getAccountRegisteDate() {
        return accountRegisteDate;
    }

    public void setAccountRegisteDate(Date accountRegisteDate) {
        this.accountRegisteDate = accountRegisteDate;
    }

    public BigDecimal getServiceFee() {
        return serviceFee;
    }

    public void setServiceFee(BigDecimal serviceFee) {
        this.serviceFee = serviceFee;
    }

    public Byte getAccountState() {
        return accountState;
    }

    public void setAccountState(Byte accountState) {
        this.accountState = accountState;
    }

    public Date getAccountModifyDate() {
        return accountModifyDate;
    }

    public void setAccountModifyDate(Date accountModifyDate) {
        this.accountModifyDate = accountModifyDate;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userId=").append(userId);
        sb.append(", accountType=").append(accountType);
        sb.append(", accountBalance=").append(accountBalance);
        sb.append(", creditMoney=").append(creditMoney);
        sb.append(", accountRegisteDate=").append(accountRegisteDate);
        sb.append(", serviceFee=").append(serviceFee);
        sb.append(", accountState=").append(accountState);
        sb.append(", accountModifyDate=").append(accountModifyDate);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserAccountInfo other = (UserAccountInfo) that;
        return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getAccountType() == null ? other.getAccountType() == null : this.getAccountType().equals(other.getAccountType()))
            && (this.getAccountBalance() == null ? other.getAccountBalance() == null : this.getAccountBalance().equals(other.getAccountBalance()))
            && (this.getCreditMoney() == null ? other.getCreditMoney() == null : this.getCreditMoney().equals(other.getCreditMoney()))
            && (this.getAccountRegisteDate() == null ? other.getAccountRegisteDate() == null : this.getAccountRegisteDate().equals(other.getAccountRegisteDate()))
            && (this.getServiceFee() == null ? other.getServiceFee() == null : this.getServiceFee().equals(other.getServiceFee()))
            && (this.getAccountState() == null ? other.getAccountState() == null : this.getAccountState().equals(other.getAccountState()))
            && (this.getAccountModifyDate() == null ? other.getAccountModifyDate() == null : this.getAccountModifyDate().equals(other.getAccountModifyDate()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getAccountType() == null) ? 0 : getAccountType().hashCode());
        result = prime * result + ((getAccountBalance() == null) ? 0 : getAccountBalance().hashCode());
        result = prime * result + ((getCreditMoney() == null) ? 0 : getCreditMoney().hashCode());
        result = prime * result + ((getAccountRegisteDate() == null) ? 0 : getAccountRegisteDate().hashCode());
        result = prime * result + ((getServiceFee() == null) ? 0 : getServiceFee().hashCode());
        result = prime * result + ((getAccountState() == null) ? 0 : getAccountState().hashCode());
        result = prime * result + ((getAccountModifyDate() == null) ? 0 : getAccountModifyDate().hashCode());
        return result;
    }
}